/*
 * @Author: i@douxuefeng.cn
 * @Date: 2021-12-18 18:16:21
 * @LastEditTime: 2021-12-23 18:07:35
 * @LastEditors: i@douxuefeng.cn
 * @Description:
 * @FilePath: \go-im\router\init_router.go
 */

package router

import (
	"gitee.com/douxuefeng/go-im/ws"
	"github.com/kataras/iris/v12"
	"github.com/kataras/iris/v12/mvc"
	"github.com/kataras/iris/v12/websocket"
)

func InitRouter(app *iris.Application) {
	mvc.Configure(app.Party("/"), func(m *mvc.Application) {
		//websocket 连接
		wsRouter := m.Party("/ws")
		wsRouter.Router.Get("/", websocket.Handler(ws.WebsocketServer(), ws.IdGenerator))

	})
}
